<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>一本财经-金融科技风控大会</title>
	<style type="text/css">
	 li{cursor: pointer;}
	</style>
</head>
<body>
<ul class="pager" style="margin: 5px 0;" count=${map['count']} pageTotal=${map['pageTotal']}>
	<li><a page="1">首页</a></li>
	<li><a page="${map['previous']}">上一页</a></li>
	<li><a href="javascript:void(0);">${map['page']}/${map['pageTotal']}页</a></li>
	<li><a page="${map['next']}">下一页</a></li>
	<li><a page="${map['last']}">尾页</a></li>
	<li>&nbsp;&nbsp;第<input type="text" class="" onkeyup="value=value.replace(/[^\d]/g,'')" maxlength="8" size="2" id="page">页</li>
    <li><a class="goPage">Go</a></li>
</ul>
</body>
<script type="text/javascript"src="<%=basePath%>js/common/jquery.form.js"></script>
	<script type="text/javascript">
	$(document).ready(function(){
		//如果没有记录， 不显示分页一栏
		var ulPageTotal=$(".pager").attr("pageTotal");
		if(parseInt(ulPageTotal)==0){
			$(".pager").hide();
		}
		
		//点击跳转分页
		$(".pager li a[page]").click(function(){
			 var modal=$(this).parents(".modal-body").length;
			 var count=$(this).parent().parent().attr("count");
			var action=$(this).parents("table").attr("action");
			 var data=$(this).parents("table").prev("#queryForm").serialize();
			var page=$(this).attr("page");
			var groupCode = $("#groupCodeFlag").val();
			var param="page="+page+"&pageSize=10&count="+count+"&dataFlag=1"+"&groupCode="+groupCode+"&"+data;
			if(modal==0){
				window.location.href=action+"?"+param;
			}else{
				$.ajax({            
	                  type:"post",
	                  url:action, 
	                  data:param,
	                  dataType:"text",
	                  success:function(data) {
	                		$(".modal-body").html(data);
	                  }            
	            });  
			}
		});
		
		$(".goPage").click(function(){
			 var modal=$(this).parents(".modal-body").length;
			var page=$(this).parent().parent().find("input").val();
			var pageTotal=$(this).parent().parent().attr("pageTotal");
			if(isNaN(page) || page == ''){
				alert("请输入数字...");
			}else{
				if(parseInt(page)>parseInt(pageTotal)){
					alert("超出最大页数，重新输入...");
				}else if(parseInt(page)==0){
					alert("输入的页数必须大于0，重新输入...");
				}else{
					var count=$(this).parent().parent().attr("count");
					var action=$(this).parents("table").attr("action");
					var data=$(this).parents("table").prev("#queryForm").serialize();
					var groupCode = $("#groupCodeFlag").val();
					var param="page="+page+"&pageSize=10&count="+count+"&dataFlag=1"+"&group_code="+groupCode+"&"+data;
					if(modal==0){
						window.location.href=action+"?"+param;
						
					}else{
						$.ajax({            
			                  type:"post",
			                  url:action, 
			                  data:param,
			                  dataType:"text",
			                  success:function(data) {
			                		$(".modal-body").html(data);
			                  }            
			            });  
					}
				}
			}
		});
	});
	</script>
</html>